package algorithm;

/**
 * 69. x 的平方根
 */
public class T00069 {
    public static void main(String[] args) {
        System.out.println(new Solution().mySqrt(2147395600));
    }

static class Solution {
    public int mySqrt(int x) {
        if(x == 0)
            return 0;
        long i = 2;
        for (; i <= x / 2; i++) {
            if(i * i > x)
                break;
        }
        return (int) (i - 1);
    }
}
}